home *** CD-ROM | disk | FTP | other *** search
- Path: ix.netcom.com!netnews
- From: chuckh@ix.netcom.com (Chuck Hamilton)
- Newsgroups: comp.lang.c
- Subject: printf - adding commas to numbers
- Date: Wed, 10 Jan 1996 19:53:17 GMT
- Organization: Mercy Health Plan
- Message-ID: <4d15eq$lc5@ixnews2.ix.netcom.com>
- NNTP-Posting-Host: ix-phi1-10.ix.netcom.com
- X-NETCOM-Date: Wed Jan 10 11:52:58 AM PST 1996
- X-Newsreader: Forte Free Agent 1.0.82
-
- Is there a simple way with a printf format specifier to add commas to
- an integer?
-
- For example, if the value of integer i is 12345 I want the output to
- be:
-
- 12,345.
-
- I know this can be done in a function but I'd think that printf ought
- to have such capability since it's such a common output format.
-
- Please respond via E-mail since I don't check this group often.
- --
- Chuck Hamilton
- chuckh@ix.netcom.com
-
- If at first you don't succeed, skydiving isn't for you.
-
-